package com.shuang.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shuang.service.DbGoodsPropertyParamService;

@Controller
@RequestMapping("/propertyParam")
public class DbGoodsPropertyParamHanlder {

	@Resource(name="dbGoodsPropertyParamService")
	private DbGoodsPropertyParamService dbGoodsPropertyParamService;
	
	@RequestMapping("/getPropertyInfoById")
	@ResponseBody
	public	Map<String ,Object> getPropertyInfoById(@RequestParam(value="id")Long gId){
		if(gId==null){
			HashMap<String, Object> map = new HashMap<String ,Object>();
			map.put("status", 403);
			map.put("data", "参数不完整");
			return map;
		}
		return dbGoodsPropertyParamService.getPropertyInfoById(gId);
	}
	@RequestMapping("/updatePropertyParamInfoById")
	@ResponseBody
	public Map<String ,Object > updatePropertyParamInfoById(@RequestParam(value="id")Long gId,String property){
		if(gId==null||property==null||property==""){
			HashMap<String, Object> map = new HashMap<String ,Object>();
			map.put("status", 403);
			map.put("data", "参数不完整");
			return map;
		}
		return dbGoodsPropertyParamService.updatePropertyParamInfoById(gId,property);
	}
}
